<?php
/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/5/10
 * Time: 下午9:09
 */

namespace App\Busi\Modules\Resource;


use App\Busi\Modules\BaseBusi;
use App\Http\Requests\CompanyStaffRo;
use App\Models\CompanyStaff;

class CompanyStaffBusi extends BaseBusi
{
    public function handle(CompanyStaffRo $ro){
        $company_id = $ro->id;
        $where = [
            ['company_id','=',$company_id]
        ];
        $fields = ['id','phone','name','avatar','experience'];
        $data = CompanyStaff::where($where)->select($fields)->get();
        foreach ($data as $item){
            $item['avatar'] = config("admin.upload.host").$item['avatar'];
        }
        return $data;
    }
}